
<div class="container"  >
    <div id='content' >
        <?php  foreach($evaluates as $k=>$v){ ?>
                <div class='thumbnail' style="float:left;">
                    <div style="height:9rem;width:9rem;overflow: hidden;">
                        <img class='_img' src="<?php  echo 'http://'.IMAGE_DOMAIN_.$v['item']['images'][0]['image'] ;?>" style='width:100%;height:100%'/>
                    </div>
                </div>
                <div style='margin-left:12rem;font-size:1.5rem' >
                    <div  style='margin-top:1rem;' ><?php echo $v['item']['name'];?></div>
                    <div style='color:red;'><i><font >￥<?php echo  $v['item']['price']/100; ?></font></i>
                         <span style='float:right;overflow:hidden;color:red'>
                          已完成
                        </span>
                    </div>
                    <?php if($v['item']['items']){  foreach($v['item']['items'] as $kk=>$vv){ ?>
                    <div>
                        <span> <?php echo $vv['name']; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;X<?php echo $vv['number']; ?></span>
                    </div>
                    <?php } } ?>

                    <input type='hidden' id='store_id' value="<?php echo $v['item']['store_id']; ?>" >
                </div>
                <div style='clear:both;'></div>
                
                <div >
                    <div style='padding:0.5rem 0 0 0;' >
                        我的评价：<?php  echo $v['relpy'];  ?>
                    </div>
                    <div style='padding:0.5rem 0 0 3%;'>
                        <span style='color:#FF8C00;' >商家回复</span>：<?php echo $v['content']; ?>
                    </div>
                    <div class='_line'></div>
                </div> 
                
                <?php } ?>


<script type="text/javascript">
$(document).ready(function(){
    //追加
    var number =12;
    function loaddata(){
        if (number == -1) {
            return;
        }
        totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());

        if ($(document).height() <= totalheight)
        {
            var store_id = $("#store_id").val();
            $.ajax({url: "/user/evaluate/unread?start="+number+ "&store_id="+store_id, async: true, 
                success: function (msg) {

                    if (msg == 'false') {
                        number = -1;
                        return;
                    }
                    var html = "";
                    msg = eval('(' + msg + ')');
                    $.each(msg, function (i, v) {
                        var image_domain = "<?php echo IMAGE_DOMAIN_;?>";
                        var img = '<?php echo "http://'+image_domain+v.item.images[0].image+'";?>';
                        html += "<div class='thumbnail' style='float:left;'>";
                        html += " <div style='height:9rem;width:9rem;overflow: hidden;'>";
                        html += "<img class='_img' src="+img+" style='width:100%;height:100%;' />";
                        html += "</div></div>";
                        html += "<div style='margin-left:12rem;font-size:1.5rem' >";
                        html += "<div  style='margin-top:1rem;' >"+v.item.name+"</div>";
                        html += "<div style='color:red;margin-top:1rem;' ><i><font >￥"+Number((v.item.price)/100)+"</font></i>";
                        html += "<span style='float:right;overflow:hidden;color:red'>已完成</span>";
                        html += "</div>";
                        if(v.item.items){
                            $.each(v.item.items, function (h, t) {
                                html += "<div><span>"+t.name+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;X"+t.number+"</div></span>";
                                
                            }); 
                        }
                        html += "</div>";
                        html += "<div style='clear:both;'></div>";
                        html += "<div style='padding:1rem 0 0 0;'>我的评价：";
                        html += v.relpy;
                        html += "</div>";
                        html += "<div style='padding:1rem 0 0 3%;'><span style='color:#FF8C00;' >商家回复</span>：";
                        html += v.content;
                        html += "</div>";
                        html += "<div class='_line'></div>";
                        number += 1;
                    });
                    $('#content').append(html);
                }
            });
        }
    } 
    $(window).scroll(function () {
        loaddata();
    });

})


</script>

